package com.unionwo.service;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.unionwo.commons.util.DateUtil;
import com.unionwo.dao.FeedBackDao;
import com.unionwo.model.FeedBack;
import com.unionwo.model.UnionResponse;
@Service("checkUpdateService")
/****
 * 
 * @author admin
 *意见反馈
 */
public class FeedbackService implements UnionService{
	@Autowired
	FeedBackDao feedBackDao;
	private Logger log = Logger.getLogger(FeedbackService.class);
	@Override
	public UnionResponse doRequest(HttpServletRequest request) throws Exception {
		UnionResponse res = new UnionResponse();
		String phone = request.getParameter("n");
		String content = request.getParameter("c");
		
		FeedBack fb = new FeedBack();
		fb.setTelephoneNumber(phone);
		fb.setContent(content);
		fb.setRecordTime(DateUtil.getCurrentDateTimeStr());
		try {
			feedBackDao.insertFeedBack(fb);
		} catch (Exception e) {
			log.error(e);
		}
		return res;
	}

}
